﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;

namespace OgrIsleri.DashBoard.Modul.Mesajlar
{
    public partial class MesajOku : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MesajlarıGetir();
        }

        private void MesajlarıGetir()
        {
            using (DbEntities db = new DbEntities())
            {
                Guid Kullanici = (Guid)Membership.GetUser().ProviderUserKey;
                var data = db.tblMesajlars.Where(o => o.AliciID == Kullanici && o.YanitID == null).ToList();

                RptListe.DataSource = data;
                RptListe.DataBind();
            }
        }

        protected void BtnYeniMesaj_Click(object sender, EventArgs e)
        {
            Response.Redirect("MesajYaz.aspx");
        }
    }
}